home *** CD-ROM | disk | FTP | other *** search
- /* Example of EasyRequester with variable arglist */
-
- x = addlib("apig.library",0,-30,0)
-
- call set_apig_globals()
-
- portname = "easyreq2_port"
- p = openport(portname)
- WaitForPort portname
-
- wintitle = "Easy Requester Example"
-
- winidcmp = IDCMP_CLOSEWINDOW
-
- winflags = WFLG_CLOSEGADGET+WFLG_DRAGBAR+WFLG_SIZEGADGET+WFLG_DEPTHGADGET+WFLG_GIMMEZEROZERO
-
- win = openwindow(portname,0,0,640,200,2,4,winidcmp,winflags,wintitle,null(),0,0,0)
-
- arglist = ALLOCMEM(100,MEMF_CLEAR) /* our arglist */
-
- /* stuff data into arglist */
- name = allocmem(80,MEMF_CLEAR) /* points to my name */
- call export(name,"Ronnie E. Kelly") /* copy name to buffer */
-
- dob = allocmem(80,MEMF_CLEAR)
- call export(dob,"04/23/17")
-
- call SETVALUE(arglist,0,4,'p',name) /* set 1st arg, name */
- call SETVALUE(arglist,4,4,'n',75) /* ... 2nd, age */
- call SETVALUE(arglist,8,4,'n',383) /* ... 3nd, weight */
- call SETVALUE(arglist,12,4,'p',dob) /* ... 4nd, dob */
-
- /* gad args follow textformat args */
- call SETVALUE(arglist,16,4,'n',1) /* gad 1 */
- call SETVALUE(arglist,20,4,'n',2) /* gad 2 */
- call SETVALUE(arglist,24,4,'n',0) /* gad 0 */
-
- wtext = "This is your EasyRequester"
-
- /* NOTE 'C' style formatting chars ... %s, %ld, etc. */
-
- rtext = " Say Buddy This is your Easy Requester " '0a'x '0a'x
- rtext = rtext || " Your Name Is %s " '0a'x "Your Age Is %ld " '0a'x
- rtext = rtext || " Your Weight Is %ld " '0a'x "Your Date of Birth Is %s " '0a'x
-
- gtext = " %ld). OKAY | %ld). MAYBE | %ld). NOWAY "
-
- x = EASYREQUEST(win,wtext,rtext,gtext,arglist,0,0)
-
- call CLOSEWINDOW(win)
- call FREEMEM(arglist,100)
- call FREEMEM(dob,80)
- call FREEMEM(name,80)
- exit
-
-